#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include <QtCore>
#include <QtGui>
#include <QDialog>
#include <QSettings>
#include <QObject>

// ---------------------- //
// CLASS : SettingsDialog //
// ---------------------- //

//SettingsDialog : dialog used to edit the application settings
class EditSettingsSaveFileWidget;
class EditSettingsMusicPathWidget;
class SettingsDialog : public QDialog
{
    Q_OBJECT

public:
    //Constructor : pointer to settings
    SettingsDialog(QWidget* parent, QSettings* settings);

public slots:
    //Save settings and quit
    void saveAndQuit();

private:
    QSettings* 			         _settings;

    EditSettingsSaveFileWidget*  _saveFileWidget;
    EditSettingsMusicPathWidget* _musicPathWidget;
    QPushButton* 		            _okButton;
    QPushButton* 		            _cancelButton;
};

// ---------------------------------- //
// CLASS : EditSettingsSaveFileWidget //
// ---------------------------------- //

//EditSettingsSaveFileWidget : just a simple QLabel/QLineEdit combination
class EditSettingsSaveFileWidget : public QWidget
{
   Q_OBJECT
   
public:
   //Constructor : default value in the QLineEdit
   EditSettingsSaveFileWidget(QWidget* parent, const QString& saveFileName);
   
   //Getter to the value in the QLineEdit
   QString getSaveFileName();
   
private:
   QLabel*	   _saveFileNameLabel;
   QLineEdit*  _saveFileNameLineEdit;
};

// ----------------------------------- //
// CLASS : EditSettingsMusicPathWidget //
// ----------------------------------- //

//EditSettingsMusicPathWidget : just a simple path editing widget
class EditSettingsMusicPathWidget : public QWidget
{
   Q_OBJECT
   
public:
   //Constructor : default path
   EditSettingsMusicPathWidget(QWidget* parent, const QString& currentPath);
   
   //Getter to the selected path
   QString getMusicPath();
   
private slots:
   //Open a dialog to select a path
   void changePath();
   
private:
   QLabel*        _musicPathLabel;
   QLineEdit*     _musicPathLineEdit;
   QPushButton*   _editMusicPathButton;
};

#endif // SETTINGSDIALOG_H
